<?php
//1:引入init.php
require("../init.php");
//2:sql语句
$sql = " SELECT * FROM dk_index_product";
$result = mysqli_query($conn, $sql);
if(mysqli_error($conn)){
    echo mysqli_error($conn);
}
echo json_encode(mysqli_fetch_all($result, MYSQLI_ASSOC));
?>